<template>
  <div class="container">
    <div class="head">
      <p>默认发送到系统消息</p>
      <!-- <template class="view1" @change="go_change">
        <el-radio v-model="radio" label="1">备选项</el-radio>
        <el-radio v-model="radio" label="2">备选项</el-radio>
      </template> -->
    </div>
    <textarea class="cont" v-model="text"></textarea>
    <el-button class="h6" :plain="true" @click="go_send">发送给客户</el-button>
  </div>
</template>

<script>
import store from '@/vuex/store.js'
import { Notification } from 'element-ui'
export default {
  data () {
    return {
      radio: '1',
      text:""
    }
  },
  store,
  methods: {
    go_send:function(){
      this.$api.Message.store({project_id:store.state.pdetail.id,user_id:store.state.pdetail.user_id,content:this.text}).then(res=>{
        this.text = ''
        //success以后
        Notification({
          title:'成功',
          message:"发送成功",
          type:'success'
        })
      })
    },
  },
  mounted () {
    store.commit('changeactive', 2)
  }
}
</script>

<style lang='scss' scoped>
  .container{
    width: calc(100% - 20px);
    height: 100%;
    font-size: 14px;
    color: #515151;
    margin-left: 20px;
    .head{
      display: flex;
      p{
        margin-right: 32px;
      }
      .view1{
        display: block;
      }
    }
    .cont{
      width: 500px;
      height: 100px;
      padding: 10px;
      font-size: 14px;
      line-height: 20px;
      color: #B4B4B4;
      margin-top: 22px;
    }
    .h6{
      width:140px;
      height:32px;
      background:rgba(86,175,247,1);
      color: #fff;
      margin-top: 20px;
      display: block;
      padding: 0;
      box-sizing: border-box;
    }
  }
  .el-message.el-message--success.is-closable{
    background: #fff;
  }
</style>